<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.3.1.min.js"></script>

</head>
<body>
<img src="img/star.gif" alt="img" width="300">

</body>
<script>
    $(function () {
        $('img').attr('alt','images');//获取属性 设置属性
        $("img").attr('src','img/bulboff.gif');
    })
</script>
</html>